package com.sky.mapper;

import com.sky.dto.OrdersPageQueryDTO;
import com.sky.entity.OrderDetail;
import com.sky.entity.Orders;
import com.sky.entity.StatusCount;
import com.sky.vo.OrderInfo;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Mapper
public interface OrderMapper {
    void insert(Orders orders);

    List<OrderInfo> select(Orders orders);

    Long selectTotal(Orders orders);

    void update(Orders orders);

    List<OrderDetail> selectDetail(Long id);

    List<Orders> conditionSearchByPage(OrdersPageQueryDTO ordersPageQueryDTO);

    @MapKey("status")
    Map<Integer, StatusCount> statistics();

    void updateByIds(List<Orders> longList);

    List<Orders> selectByOrder(Orders orders);

    List<Orders> selectByOrderTime(LocalDateTime begin, LocalDateTime end, Integer status);
}
